<div>
{%include[admin/tinymce_init.html]%}
<h1>Изменение страницы</h1>
<form action="{%link[{%class%},{%method%},menu={%id_menu%},id={%id%}]%}" method="post" enctype="multipart/form-data">
<input type="hidden" name="edit" value="1" />
<table>
{%parent_exists%}
<tr>
   <td class="w150" valign="top">
      Родительский элемент <span class="required">*</span>
   </td>
   <td>
      {%parents%}
   </td>
</tr>
{%/parent_exists%}
<tr>
   <td class="w100" valign="top">
      Заголовок <span class="required">*</span>
   </td>
   <td>
      <input type="text" name="title" value="{%title%}" size="50" class="i" />
      {%error_title%}
   </td>
</tr>
<tr>
   <td class="w100" valign="top">
      Ссылка
   </td>
   <td>
      <input type="text" name="link" value="{%link%}" size="50" class="i" />
      {%error_link%}
   </td>
</tr>
<tr>
   <td class="w100" valign="top">
      Документ
   </td>
   <td>
      <input type="hidden" name="hidden_document" value="{%document%}" />
      <input type="hidden" name="hidden_document_name" value="{%document_name%}" />
      <input type="file" name="document" size="50" class="i" />
      {%error_document%}
   </td>
</tr>
{%document_exists%}
<tr id="preview_document">
   <td class="w100" valign="top">
      &nbsp;
   </td>
   <td nowrap="nowrap">
      <img src="{%base_url%}images/admin/{%document_type%}.gif" width="16" height="16" alt="" align="absmiddle" />
      <strong>{%document_name%}</strong>
      <img src="{%base_url%}images/admin/delete.gif" alt="" title="Удалить" onclick="remove_element('document')" align="absmiddle" />
   </td>
</tr>
{%/document_exists%}
<!--
<tr>
   <td class="w100" valign="top">
      Изображение
   </td>
   <td>
      <input type="hidden" name="hidden_image" value="{%image%}" />
      <input type="file" name="image" size="50" class="i" />
      {%error_image%}
   </td>
</tr>
{%image_exists%}
<tr id="preview_image">
   <td class="w100" valign="top">
      &nbsp;
   </td>
   <td nowrap="nowrap">
      <img src="{%base_url%}{%widget[thumbnail,src={%image%},size=100x100]%}" alt="" align="left" />
      <img src="{%base_url%}images/admin/delete.gif" alt="" title="Удалить" onclick="remove_element('image')" />
   </td>
</tr>
{%/image_exists%}
-->
<tr>
   <td colspan="2">
      <input type="checkbox" name="advanced" id="advanced" onclick="show_advanced(this.checked)" />
      <label for="advanced">Дополнительные опции</label>
   </td>
</tr>

<!-- Advanced block -->
<tbody id="advanced-block" class="hide">
<tr>
   <td class="w100" valign="top">
      URI сегмент
   </td>
   <td>
      <input type="text" name="uri_segment" value="{%uri_segment%}" size="50" class="i" />
      {%error_uri_segment%}
   </td>
</tr>
<tr>
   <td valign="top">
      Шаблон
   </td>
   <td align="left">
      {%templates%}
   </td>
</tr>
<tr>
   <td class="w100" valign="top">
      Заголовок страницы
   </td>
   <td>
      <input type="text" name="page_title" value="{%page_title%}" size="50" class="i" />
   </td>
</tr>
<tr>
   <td class="w100" valign="top">
      Ключевые слова
   </td>
   <td>
      <input type="text" name="page_keywords" value="{%page_keywords%}" size="50" class="i" />
   </td>
</tr>
<tr>
   <td class="w100" valign="top">
      Описание
   </td>
   <td>
      <textarea name="page_description" class="i" cols="47" rows="5">{%page_description%}</textarea>
   </td>
</tr>
</tbody>
<!-- end of Advanced block -->

<tr>
   <td colspan="2">
      &nbsp;
   </td>
</tr>
<tr>
   <td colspan="2">
      <textarea name="content" id="text-content" class="i" cols="150" rows="40">{%content%}</textarea>
   </td>
</tr>
<tr>
   <td colspan="2">
      &nbsp;
   </td>
</tr>
<tr>
   <td colspan="2">
      <input type="submit" value="Изменить" class="b" />
   </td>
</tr>
</table>
</form>
</div>
<script type="text/javascript">
function remove_element(elem) {
   jQuery('input[name=hidden_' + elem + ']').val('');
   jQuery('#preview_' + elem).remove();
}
function show_advanced(flag) {
   if (flag) {
      jQuery('#advanced-block').removeClass('hide');
   } else {
      jQuery('#advanced-block').addClass('hide');
   }
}
if ('' != '{%advanced%}') {
   jQuery('#advanced').click();
}
</script>